typedef char ElemType;
typedef struct BiTNode{
	ElemType data;
    BiTNode *lchild,*rchild;     
}BiTNode,*BiTree;

void CreateBiTree(BiTree& t){
	ElemType ch;
	cin>>ch;
	if(ch=='#') t=NULL;
	else{
		t=new BiTNode;
		t->data=ch;
		CreateBiTree(t->lchild);
		CreateBiTree(t->rchild);
	}
}
void PreOrderTraverse(BiTree t){
		if(t==NULL)
			return ;
		else{
			cout<<t->data;
			PreOrderTraverse(t->lchild);
			PreOrderTraverse(t->rchild);
		}
}

void InOrderTraverse(BiTree t){
	  if(t==NULL) return ; 
  else{    
		InOrderTraverse(t->lchild); 
		cout<<t->data; 
		InOrderTraverse(t->rchild);
  }
}

void PostOrderTraverse(BiTree t){
	if(t==NULL) return ; 
  else{    
     PostOrderTraverse(t->lchild); 
     PostOrderTraverse(t->rchild); 
     cout<<t->data; 
  }
}